Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a custom logs panel #46

Merged
merged 4 commits into from
Jan 16, 2024
Merged

Conversation

kyle-sammons
Copy link
Collaborator

@kyle-sammons kyle-sammons commented Jan 8, 2024

Summary

This PR adds a custom logs panel instead of using the builtin Grafana logs panel, giving us total control over the it. The builtin Grafana panel does a lot for you, but provides no customization if you want to do things differently (even minor things like custom styling seem to be impossible). With this custom rewrite we've already been able to reduce several pain points and difficulties we ran into going the builtin route.

Though this is only the first pass, it contains all the necessary functionality to be usable, including:

  • Rendering all the logs in a clean and easily readable format
  • Unfurling a log and seeing the full contents
  • Automatically linking from a trace in KalDB to the associated datasource (such as Zipkin)

And while it's not necessary functionality, we were able to also virtualize the logs panel (although there is a bug in it, see #45)

That said, there are some features missing from this that we'll be adding in later. Things like:

  • Pagination
  • Adding a new column to the table to render just that field in the column
  • Adding a raw JSON view
  • Allowing for some more customization (read: not hardcoding as many things)

Demo

Due to this rewrite being so extensive, it's difficult to demo all the functionality in a succinct way. It's recommended you pull this and try it out for yourself.

Performance

There was a decent performance boost from this rewrite. We've reduced the number of DOM elements by over half (previous was ~25k elements, current is ~11.5k elements) and have improved our Lighthouse Score (an imperfect metric, but a readily available one). I've attached the old and new Lighthouse Score below:

Old:

image

New:

image

Resolves #36

Requirements (place an x in each [ ])

The following point can be removed after setting up CI (such as Travis) with coverage reports (such as Codecov)

  • I've written tests to cover the new code and functionality included in this PR.

The following point can be removed after setting up a CLA reporting tool such as cla-assistant.io

@kyle-sammons kyle-sammons requested a review from bryanlb January 8, 2024 23:07
src/datasource/components/FieldValueFrequency.tsx Outdated Show resolved Hide resolved
src/datasource/components/Logs/LogsCell.tsx Outdated Show resolved Hide resolved
src/datasource/components/Logs/LogsCell.tsx Outdated Show resolved Hide resolved
src/datasource/components/Logs/LogsCell.tsx Show resolved Hide resolved
src/datasource/components/Logs/LogsCell.tsx Outdated Show resolved Hide resolved
src/datasource/components/Logs/LogsCell.tsx Outdated Show resolved Hide resolved
src/datasource/components/Logs/LogsTable.tsx Outdated Show resolved Hide resolved
@kyle-sammons kyle-sammons merged commit a71a3c5 into master Jan 16, 2024
2 checks passed
@kyle-sammons kyle-sammons deleted the ksammons-add-custom-log-row-renderer branch January 16, 2024 23:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add custom log row rendering
2 participants